<template>
    <!-- 为ECharts准备一个具备大小（宽高）的Dom -->
    <div id="turnover" style="width: 100%; height: 400px"></div>
</template>

<script setup lang="ts">

//按需引入
import { defineComponent, onMounted } from "vue"

//引入创建的echarts.ts文件
import echarts from '@/util/echart'



onMounted(() => {
    var chartDom = document.getElementById("turnover")!
    var myChart = echarts.init(chartDom)
    var option = {
        tooltip: {},
        legend: {
            data: ["销量"],
        },
        xAxis: {
            data: ["衬衫", "羊毛衫", "雪纺衫", "裤子", "高跟鞋", "袜子"],
        },
        yAxis: {},
        series: [
            {
                name: "销量",
                type: "bar",
                data: [5, 20, 36, 10, 10, 20],
            },
        ],
    }
    myChart.setOption(option);
})



</script>
<style scoped></style>